package com.gt.self.service.impl;

import com.gt.common.AjaxResult;
import com.gt.self.domain.UsPrintInfo;
import com.gt.self.domain.vo.SynPrintInfoVo;
import com.gt.self.service.SynDataService;
import com.gt.self.service.UsCheckListService;
import com.gt.self.service.UsPrintInfoService;
import com.gt.self.service.UsPrintTaskService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SynDataServiceImpl implements SynDataService {

    @Autowired
    private UsCheckListService usCheckListService;

    @Autowired
    private UsPrintInfoService usPrintInfoService;

    @Autowired
    private UsPrintTaskService usPrintTaskService;


    @Override
    public AjaxResult synPrintPDF(SynPrintInfoVo synPrintInfoVo) {
        UsPrintInfo usPrintInfo = new UsPrintInfo();

        BeanUtils.copyProperties(synPrintInfoVo,usPrintInfo);
        usPrintInfo.setPrintStatus("未打印");
        boolean save = usPrintInfoService.save(usPrintInfo);
        if (save){
            return AjaxResult.success();
        }
        return AjaxResult.error("同步失败");
    }
}
